Class symantec.itools.multimedia.MovingAnimation
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.multimedia.MovingAnimation

Object
   |
   +----Component
           |
           +----Canvas
                   |
                   +----Animator
                           |
                           +----symantec.itools.multimedia.MovingAnimation

public class MovingAnimation
extends Animator
implements Runnable
MovingAnimation component. Draws a series of images at sequential horizontal positions within the component area. Each frame is drawn at a given offset from the previous frame.

Version:
1.0, Nov 26, 1996
Author:
Symantec
See Also:
Animator

Variable Index

 o loopslot
Index of the image to draw.
 o shiftOffset
The amount each image is shifted horizontally from the previous image.

Constructor Index

 o symantec.itools.multimedia.MovingAnimation()
Constructs a default MovingAnimation.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all event changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a vetoable listener for all event changes.
 o getShiftOffset()
Gets the animation shift offset.
 o imageUpdate(Image, int, int, int, int, int)
Incrementally updates an image as image data becomes available.
 o paint(Graphics)
Paints this component using the given graphics context.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all event changes.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable listener for all event changes.
 o run()
Body of MovingAnimation Thread.
 o setShiftOffset(int)
Sets the animation shift offset.

Variables

 o loopslot
protected transient int loopslot
Index of the image to draw. A loop counter.

 o shiftOffset
protected int shiftOffset
The amount each image is shifted horizontally from the previous image. The offset may be positive or negative. If the offset is positive, the first image is drawn on the left side of the component and subsequent images are drawn to the right of the first image by offset pixels. If the offset is negative, the first image is drawn at the right side of the component area.

Constructors

 o MovingAnimation
public MovingAnimation()
Constructs a default MovingAnimation.

Methods

 o addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all event changes.

Parameters:
PropertyChangeListener - listener the listener to add.
Overrides:
addPropertyChangeListener in class Animator
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
Adds a vetoable listener for all event changes.

Parameters:
VetoableChangeListener - listener the listener to add.
Overrides:
addVetoableChangeListener in class Animator
See Also:
removeVetoableChangeListener
 o getShiftOffset
public int getShiftOffset()
Gets the animation shift offset.

Returns:
int current shift offset amount, in pixels
See Also:
setShiftOffset
 o imageUpdate
public boolean imageUpdate(Image img,
                           int flags,
                           int x,
                           int y,
                           int w,
                           int h)
Incrementally updates an image as image data becomes available. This is a standard Java AWT method which gets called by the AWT to incrementally draw an image as more image data becomes available.

Parameters:
img - the image being drawn
flags - image update flags (see class ImageObserver)
x - horizontal position
y - vertical position
w - width
h - height
Returns:
true if image has been completely loaded
Overrides:
imageUpdate in class Component
See Also:
ImageObserver, imageUpdate
 o paint
public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner. The horizontal position of the image is shifted according to the current offset.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Animator
See Also:
repaint, update
 o removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all event changes.

Parameters:
PropertyChangeListener - listener the listener to remove.
Overrides:
removePropertyChangeListener in class Animator
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable listener for all event changes.

Parameters:
VetoableChangeListener - listener the listener to remove.
Overrides:
removeVetoableChangeListener in class Animator
See Also:
addVetoableChangeListener
 o run
public void run()
Body of MovingAnimation Thread. This method is called by the Java Virtual Machine in response to a call to the start method of this object.

Overrides:
run in class Animator
 o setShiftOffset
public void setShiftOffset(int newShiftOffset) throws PropertyVetoException
Sets the animation shift offset. Each image is shifted horizontally from the previous image by the specified offset. Offset may be positive or negative. If the offset is positive, the first image is drawn on the left side of the component and subsequent images are drawn to the right of the first image by offset pixels. If the offset is negative, the first image is drawn at the right side of the component area.

Parameters:
newShiftOffset - shift offset amount, in pixels
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getShiftOffset

All Packages  Class Hierarchy  This Package  Previous  Next  Index